home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
u_man
/
cat3
/
Tk
/
canvtxtinfo.z
/
canvtxtinfo
Wrap
Text File
|
1998-10-30
|
7KB
|
133 lines
TTTTkkkk____CCCCaaaannnnvvvvaaaassssTTTTeeeexxxxttttIIIInnnnffffoooo((((3333TTTTkkkk)))) TTTTkkkk____CCCCaaaannnnvvvvaaaassssTTTTeeeexxxxttttIIIInnnnffffoooo((((3333TTTTkkkk))))
NNNNAAAAMMMMEEEE
Tk_CanvasTextInfo - additional information for managing text items in
canvases
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
####iiiinnnncccclllluuuuddddeeee <<<<ttttkkkk....hhhh>>>>
Tk_CanvasTextInfo *
TTTTkkkk____CCCCaaaannnnvvvvaaaassssGGGGeeeettttTTTTeeeexxxxttttIIIInnnnffffoooo(_c_a_n_v_a_s)
AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
Tk_Canvas _c_a_n_v_a_s (in) A token that identifies a particular
canvas widget.
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
Textual canvas items are somewhat more complicated to manage than other
items, due to things like the selection and the input focus.
TTTTkkkk____CCCCaaaannnnvvvvaaaassssGGGGeeeettttTTTTeeeexxxxttttIIIInnnnffffoooo may be invoked by a type manager to obtain
additional information needed for items that display text. The return
value from TTTTkkkk____CCCCaaaannnnvvvvaaaassssGGGGeeeettttTTTTeeeexxxxttttIIIInnnnffffoooo is a pointer to a structure that is
shared between Tk and all the items that display text. The structure has
the following form:
typedef struct Tk_CanvasTextInfo {
Tk_3DBorder _s_e_l_B_o_r_d_e_r;
int _s_e_l_B_o_r_d_e_r_W_i_d_t_h;
XColor *_s_e_l_F_g_C_o_l_o_r_P_t_r;
Tk_Item *_s_e_l_I_t_e_m_P_t_r;
int _s_e_l_e_c_t_F_i_r_s_t;
int _s_e_l_e_c_t_L_a_s_t;
Tk_Item *_a_n_c_h_o_r_I_t_e_m_P_t_r;
int _s_e_l_e_c_t_A_n_c_h_o_r;
Tk_3DBorder _i_n_s_e_r_t_B_o_r_d_e_r;
int _i_n_s_e_r_t_W_i_d_t_h;
int _i_n_s_e_r_t_B_o_r_d_e_r_W_i_d_t_h;
Tk_Item *_f_o_c_u_s_I_t_e_m_P_t_r;
int _g_o_t_F_o_c_u_s;
int _c_u_r_s_o_r_O_n;
} Tk_CanvasTextInfo;
The sssseeeellllBBBBoooorrrrddddeeeerrrr field identifies a Tk_3DBorder that should be used for
drawing the background under selected text. _s_e_l_B_o_r_d_e_r_W_i_d_t_h gives the
width of the raised border around selected text, in pixels.
_s_e_l_F_g_C_o_l_o_r_P_t_r points to an XColor that describes the foreground color to
be used when drawing selected text. _s_e_l_I_t_e_m_P_t_r points to the item that
is currently selected, or NULL if there is no item selected or if the
canvas doesn't have the selection. _s_e_l_e_c_t_F_i_r_s_t and _s_e_l_e_c_t_L_a_s_t give the
indices of the first and last selected characters in _s_e_l_I_t_e_m_P_t_r, as
returned by the _i_n_d_e_x_P_r_o_c for that item. _a_n_c_h_o_r_I_t_e_m_P_t_r points to the
item that currently has the selection anchor; this is not necessarily
the same as _s_e_l_I_t_e_m_P_t_r. _s_e_l_e_c_t_A_n_c_h_o_r is an index that identifies the
anchor position within _a_n_c_h_o_r_I_t_e_m_P_t_r. _i_n_s_e_r_t_B_o_r_d_e_r contains a
PPPPaaaaggggeeee 1111
TTTTkkkk____CCCCaaaannnnvvvvaaaassssTTTTeeeexxxxttttIIIInnnnffffoooo((((3333TTTTkkkk)))) TTTTkkkk____CCCCaaaannnnvvvvaaaassssTTTTeeeexxxxttttIIIInnnnffffoooo((((3333TTTTkkkk))))
Tk_3DBorder to use when drawing the insertion cursor; _i_n_s_e_r_t_W_i_d_t_h gives
the total width of the insertion cursor in pixels, and _i_n_s_e_r_t_B_o_r_d_e_r_W_i_d_t_h
gives the width of the raised border around the insertion cursor.
_f_o_c_u_s_I_t_e_m_P_t_r identifes the item that currently has the input focus, or
NULL if there is no such item. _g_o_t_F_o_c_u_s is 1 if the canvas widget has
the input focus and 0 otherwise. _c_u_r_s_o_r_O_n is 1 if the insertion cursor
should be drawn in _f_o_c_u_s_I_t_e_m_P_t_r and 0 if it should not be drawn; this
field is toggled on and off by Tk to make the cursor blink.
The structure returned by TTTTkkkk____CCCCaaaannnnvvvvaaaassssGGGGeeeettttTTTTeeeexxxxttttIIIInnnnffffoooo is shared between Tk and
the type managers; typically the type manager calls TTTTkkkk____CCCCaaaannnnvvvvaaaassssGGGGeeeettttTTTTeeeexxxxttttIIIInnnnffffoooo
once when an item is created and then saves the pointer in the item's
record. Tk will update information in the Tk_CanvasTextInfo; for
example, a ccccoooonnnnffffiiiigggguuuurrrreeee widget command might change the _s_e_l_B_o_r_d_e_r field, or
a sssseeeelllleeeecccctttt widget command might change the _s_e_l_e_c_t_F_i_r_s_t field, or Tk might
change _c_u_r_s_o_r_O_n in order to make the insertion cursor flash on and off
during successive redisplays.
Type managers should treat all of the fields of the Tk_CanvasTextInfo
structure as read-only, except for _s_e_l_I_t_e_m_P_t_r, _s_e_l_e_c_t_F_i_r_s_t, _s_e_l_e_c_t_L_a_s_t,
and _s_e_l_e_c_t_A_n_c_h_o_r. Type managers may change _s_e_l_e_c_t_F_i_r_s_t, _s_e_l_e_c_t_L_a_s_t, and
_s_e_l_e_c_t_A_n_c_h_o_r to adjust for insertions and deletions in the item (but only
if the item is the current owner of the selection or anchor, as
determined by _s_e_l_I_t_e_m_P_t_r or _a_n_c_h_o_r_I_t_e_m_P_t_r). If all of the selected text
in the item is deleted, the item should set _s_e_l_I_t_e_m_P_t_r to NULL to
indicate that there is no longer a selection.
KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
canvas, focus, insertion cursor, selection, selection anchor, text
PPPPaaaaggggeeee 2222